package com.ir;

import com.sysdep.CodeGenerator;

public class Assign extends Expr {// "a=b+c"
    Expr lhs, rhs;

    public Assign(Expr lhs, Expr rhs) {
        this.lhs = lhs;
        this.rhs = rhs;
    }

    public Expr getLhs() {
        return lhs;
    }

    public Expr getRhs() {
        return rhs;
    }

    @Override
    public String toString() {
        return lhs + " = " + rhs;
    }
    @Override
    public boolean accept(CodeGenerator cg) {
        return cg.visit(this);
    }

    @Override
    public int getIntValue() {
        throw new Error("getIntValue() not supported in Assign");
    }
}